/*
 * Copyright 2007 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.jtell;

/**
 * <p>
 * <code>CircularOrderException</code> is thrown when two event sink adapters contain ordering information which creates
 * a circularity.
 * </p>
 */
public class CircularOrderException extends JTellException
{
    /**
     * <p>
     * The first event sink.
     * </p>
     */
    private final EventSink m_eventSink1;

    /**
     * <p>
     * The second event sink. 
     * </p>
     */
    private final EventSink m_eventSink2;

    /**
     * <p>
     * Construct a {@link CircularOrderException} instance.
     * </p>
     *
     * @param message the exception message.
     * @param eventSink1 the first event sink.
     * @param eventSink2 the second event sink.
     */
    public CircularOrderException(final String message,
                                  final EventSink eventSink1,
                                  final EventSink eventSink2)
    {
        super(message);

        m_eventSink1 = eventSink1;
        m_eventSink2 = eventSink2;
    }

    /**
     * <p>
     * Get the first conflicting event sink.
     * </p>
     *
     * @return {@link EventSink} instance.
     */
    public EventSink getEventSink1()
    {
        return m_eventSink1;
    }

    /**
     * <p>
     * Get the second conflicting event sink.
     * </p>
     *
     * @return {@link EventSink} instance.
     */
    public EventSink getEventSink2()
    {
        return m_eventSink2;
    }
}
